package com.bsoft.service;

import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.index.reindex.BulkByScrollResponse;

import java.io.IOException;

public interface IRestHighLevelClientService {
    //创建索引
    CreateIndexResponse createIndex() throws IOException;

    //删除索引
    AcknowledgedResponse deleteIndex() throws IOException;

    //查看索引是否存在
    boolean existIndex() throws IOException;

    // 更新索引的settings配置
    AcknowledgedResponse updateIndexSettings() throws IOException;

    // 更新索引的mapping配置
    AcknowledgedResponse updateIndexMapping() throws IOException;

    // 新增文档
    IndexResponse addDocument() throws IOException;

    // 修改文档
    UpdateResponse updateDocument() throws IOException;

    // 根据id删除文档
    DeleteResponse deleteDocumentById() throws IOException;

    // 根据条件删除文档
    BulkByScrollResponse deleteDocumentByCon() throws IOException;

    // 批量操作文档
    BulkResponse bulkDocument() throws IOException;

    // 查询操作
    SearchResponse searchDocument1() throws IOException;

    // 查询操作2
    SearchResponse searchDocument2() throws IOException;

    // 高亮查询
    SearchResponse searchDocument3() throws IOException;


}
